<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jsp/jstl/core">
    <h:head>
        <title>SGP - Porcentagem de Projeto</title>
    </h:head>
    <h:body>
        <ui:insert name="header" >
            <ui:include src="cabecalho.xhtml" />
        </ui:insert>
        <div id="conteudo">
            <div id="conteudo-table-interno">
                <hr /><br />
                <h2>Selecionar</h2><br />
                <hr /><br />
                <h:form>
                    <table border="0" cellpadding="0" cellspacing="2" align="left" width="98%">            
                        <tr>
                            <td align="right"><label><span class="obr">*</span> Projeto</label></td>
                            <td width="313">
                                <div class="branco">
                                    <h:selectOneMenu id="estado" value="#{beanRelatorio.projetoSelecionado}" converter="simpleEntityConverter" required="true" style="width: 310px;" requiredMessage="" >
                                        <f:selectItem itemValue="" itemLabel="Selecione"/>
                                        <f:selectItems value="#{beanRelatorio.listaProjetos}" var="projeto" itemLabel="#{projeto.nomeProjeto}" itemValue="#{projeto}" ></f:selectItems>
                                    </h:selectOneMenu><br />
                                </div>
                            </td>
                            <td align="right"><label><span class="obr">*</span> Porcentagem de Conclusão</label></td>
                            <td width="100">
                                <div class="branco">
                                    <h:inputText readonly="true" value="#{beanRelatorio.porcentagemProjeto.porcentagem}" style="width: 90px;"/><br />
                                </div>
                            </td>
                            <td align="left" width="200" >
                                <span class="obr">&nbsp;</span>
                            </td>
                            <td align="right">
                                <h:commandButton value="Buscar" class="botao" action="#{beanRelatorio.listaAtividades()}" />
                            </td>
                        </tr>
                    </table>
                    <div class="clear"></div>
                </h:form>    
                <div class="clear"></div>
                
                <br />
                <hr /><br />
                <h2>Listar</h2><br />
                <hr /><br />
                <h:form rendered="#{not empty beanRelatorio.listaAtividadesRelacionadas}" >
                    <h:dataTable id="dataTableCliente" class="dataTableCliente" cellpadding="0" cellspacing="1" var="atividade" value="#{beanRelatorio.listaAtividadesRelacionadas}"  >
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Nome da Atividade"/>
                            </f:facet>
                            <h:outputText value="#{atividade.nomeAtividade}" />
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Data de entrega" />
                            </f:facet>
                            <h:outputText value="#{atividade.dataEntrega}" />
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Status" />
                            </f:facet>
                            <h:outputText value="#{atividade.status.status}" />
                        </h:column>
                    </h:dataTable>
                </h:form>
            </div>
        </div>     
    </h:body>
</html>
